import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useTargetStore = defineStore('target', () => {
  const targets = ref([])
  function setupTarget(targetData) {
    targets.value = targetData
  }
  function findTarget(pos) {
    return targets.value.find((f) => f.x === pos.x && f.y == pos.y)
  }
  return {
    targets,
    setupTarget,
    findTarget,
  }
})
